package TestCases;

import static org.junit.Assert.*;

import java.util.ArrayList;

import org.junit.Test;

import fxTrader.retriever.CurrencyRetriever;

import updater.currency.data.Currency;

public class RetrieverTestCase {

	@Test
	public void TestCase1_getCurrencyListBySymbol() {
		
		ArrayList<Currency> currencyList  = CurrencyRetriever.getCurrencyListBySymbol("JPY");
		assertEquals(currencyList.size(), currencyList.size());
	}
	@Test
	public void TestCase2_getCurrencyListBySymbol() {
		
		ArrayList<Currency> currencyList  = CurrencyRetriever.getCurrencyListBySymbol("EUR");
		assertEquals(currencyList.size(), currencyList.size());
	}
	@Test
	public void TestCase3_getCurrencyListBySymbol() {
		
		ArrayList<Currency> currencyList  = CurrencyRetriever.getCurrencyListBySymbol("USD");
		assertEquals(currencyList.size(), currencyList.size());
	}
	@Test
	public void TestCase4_getCurrencyListBySymbol() {
		
		ArrayList<Currency> currencyList  = CurrencyRetriever.getCurrencyListBySymbol("TWD");
		assertEquals(currencyList.size(), currencyList.size());
	}

	
	@Test
	public void TestCase1_getCurrencyListBySymbolAndLatestDays() {
		// Get the lastest 20 records from the whole records
		ArrayList<Currency> currencyList  = CurrencyRetriever.getCurrencyListBySymbolAndLatestDays("JPY",20);
		System.out.println("TestCase1_getCurrencyListBySymbolAndLatestDays "+currencyList.size());
		assertEquals(currencyList.size(), currencyList.size());
	}
	@Test
	public void TestCase2_getCurrencyListBySymbolAndLatestDays() {
		// Get all the records when no.Latest_day > total
		ArrayList<Currency> currencyList  = CurrencyRetriever.getCurrencyListBySymbolAndLatestDays("JPY",100);
		System.out.println("TestCase2_getCurrencyListBySymbolAndLatestDays "+currencyList.size());
		assertEquals(currencyList.size(), currencyList.size());
	}
	@Test
	public void TestCase1_getLatestCurrencyBySymbol() {
		// Get all the records when no.Latest_day > total
		Currency currencyList  = CurrencyRetriever.getLatestCurrencyBySymbol("JPY");
		assertEquals(currencyList, currencyList);
	}
	
}
